package com.cy.pj.yy.controller;

import com.cy.pj.yy.pojo.DoSickRoom;
import com.cy.pj.yy.pojo.JsonResult;
import com.cy.pj.yy.service.DoSickRoomService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class DoSickRoomController {
    @Autowired
    private DoSickRoomService doSickRoomService;
    @RequestMapping("doFindByTraid")
    public JsonResult doFindByTraid(Integer Traid){
        List<DoSickRoom> list = doSickRoomService.findByTraid(Traid);
        return new JsonResult(list);
    }
    @RequestMapping("doFindObjects")
    public JsonResult doFindObjects(){
        List<DoSickRoom> list = doSickRoomService.findObjects();
        return new JsonResult(list);
    }


    @RequestMapping("doaddAll")
    public JsonResult doaddAll(DoSickRoom d){
        doSickRoomService.addAll(d);
        return new JsonResult("ok");
        //?Traid=3&patientname=sandy&Roomid=10&Department=内科&number=3&fullnumber=4
    }
}
